/*
 * 知识管理
 * */

import http from "@/utils/http";

/*
 * 关键词回复
 * */

// 关键词回复 列表
export async function antistopReplyList(params) {
	return http.get("/qa/keyword/list", params);
}

// 关键词修改
export async function antistopAlter(params) {
	return http.post("/qa/keyword/edit", params);
}

// 关键词 新增保存
export async function antistopSave(params) {
	return http.post("/qa/keyword/add", params);
}

export async function antistopSaveNew(params) {
	return http.post("/keyword/addKeyword", params);
}

// 关键词 删除
export async function antistopDelete(params) {
	return http.postFormData("/qa/keyword/delete", params);
}

// 关键词 词典列表
export async function dictionaryList(params) {
	return http.get("/base/model/list", params);
}

// 关键词 选择词典验证
export async function dictionaryCertification(params) {
	return http.post("/qa/keyword/checkDict", params);
}

// 关键词 根据id获取关键词详情
export async function fetchDetailById(params) {
	return http.get("/qa/keyword/info", params);
}

// 关键词 停启用
export async function fetchDetailDisable(data) {
	return http.post("/qa/keyword/disable", data);
}

/*
 * 知识库共享
 * */

// 查询分享的知识点列表
export async function shareList(params) {
	return http.post("/share/shared-category/getSharedCategoryList", params);
}

// 分享的知识点
export async function shareKnowledge(params) {
	return http.post("/share/shared-category/doShare", params);
}

// 查询分享知识点内容
export async function inquireShare(params) {
	return http.get("/share/shared-category/categoryTree", params);
}

// 删除分享的知识点
export async function deleteShare(params) {
	return http.post("/share/shared-category/deleteSharedCategory", params);
}

/*
 * 知识库总览
 * */

// 知识库智能维护 问题库列表
export async function knowledgeQuestionList(params) {
	return http.post("/learn/knowledge/question/list", params);
}

// 知识库总揽 分类树
export async function knowledgeClassification(params) {
	return http.get("/qa/category/tree", params);
}

// 智能学习 添加知识点 => 分类树
export async function knowledgeAiLearningTree(params) {
	return http.get("/qa/category/aiLearning/tree", params);
}

// 知识库总揽 删除分类
export async function knowledgeDelete(params) {
	return http.postFormData("/qa/category/delete", params);
}

// 知识库总揽 启用/停用分类
export async function knowledgeDisableOpen(params) {
	return http.post("/qa/category/disabled", params);
}

// 知识库总揽 停用分类
export async function knowledgeDisableOpens(params) {
	return http.post("/knowledge/base/category/disable", params);
}

// 知识库总揽 修改分类名称
export async function knowledgeClassifyName(params) {
	return http.post("/qa/category/edit/name", params);
}

// 知识库总揽 移动分类
export async function knowledgeMoveClassify(params) {
	return http.post("/knowledge/base/category/move", params);
}

// 知识库总揽 添加分类
export async function knowledgeAddClassify(params) {
	return http.post("/qa/category/add", params);
}

// 知识库总揽 搜索知识点列表
export async function knowledgeSeekList(params) {
	return http.get("/qa/list", params);
}


// 模板市场-->系统知识库-->列表
export async function knowledgeTemplateInfo(params) {
	return http.get("/knowledge/systemTemplate/getTemplateInfo", params);
}
// 模板市场-->知识库-->知识点分类
export async function knowledgeQaCategoryTree(params) {
	return http.get("/knowledge/systemTemplate/getQaCategoryTree", params);
}
// 模板市场-->知识库-->知识点列表
export async function knowledgeListQa(params) {
	return http.get("/knowledge/systemTemplate/listQa", params);
}
// 模板市场-->知识库-->知识点详情
export async function knowledgeQaInfo(params) {
	return http.get("/knowledge/systemTemplate/getQaInfo", params);
}

// 模板市场-->知识库知识点分类
export async function knowledgeTenantQaCategory(params) {
	return http.get('/knowledge/systemTemplate/getTenantQaCategory', params);
}
// 模板市场-->通过系统模板导入
export async function knowledgeImportByTemplate(params) {
	return http.post('/knowledge/systemTemplate/importByTemplate', params);
}
// 模板市场-->获取所有的问答知识点分类
export async function knowledgeAllQaCategoryTree(params) {
	return http.get('/knowledge/systemTemplate/getAllQaCategoryTree', params);
}
// 模板市场-->获取所有的文档知识点分类
export async function knowledgeAllFileCategoryTree(params) {
	return http.get('/knowledge/systemTemplate/getAllDocCategoryTree', params);
}

// 模板市场-->导入问答知识点
export async function knowledgeImportQa(params) {
	return http.post('/knowledge/systemTemplate/importQa', params);
}
// 模板市场-->导入知识导图
export async function knowledgeImportAtlas(params) {
	return http.post('/knowledge/systemTemplate/importAtlas', params);
}
// 模板市场-->导入多轮会话
export async function knowledgeImportDialog(params) {
	return http.post('/knowledge/systemTemplate/importDialog', params);
}


// 知识库总揽 上移下移分类
export async function knowledupOrDownCategory(params) {
	return http.postFormData("/qa/category/upOrDownCategory", params);
}

// 知识库总揽 知识点合并接口
export async function knowledcombine(params) {
	return http.post("/knowledge/base/combine", params);
}

// 知识库总览 知识点删除接口
export async function knowledDelete(params) {
	return http.post("/qa/delete", params);
}

// 相似问模板 获取相似问模板列表
export async function knowledQuestionTemplateList(params) {
	return http.post("/qa/questionTemplateList", params);
}

// 相似问模板 替换模板问题占位符
export async function knowledQuestionTemplateValues(params) {
	return http.post("/qa/questionTemplateValues", params);
}

// 知识库管理 提交相似问
export async function knowaddQuestion(params) {
	return http.post("/knowledge/base/addQuestion", params);
}

// 根据词槽id查询词槽详情
export async function fetchSlotDetailBySlotId(params) {
	return http.post("/knowledge/base/getSlotValues", params);
}

//  知识库管理 获取知识点问题推荐任务状态
export async function baseQaRecommendStatus(params) {
	return http.get("/knowledge/base/qaRecommend/status", params);
}

//  知识库管理 获取知识点问题推荐任务进度
export async function baseQaRecommendProcess(params) {
	return http.get("/knowledge/base/qaRecommend/process", params);
}

// 知识库管理 获取知识点问题推荐任务结果列表
export async function qaRecommendList(params) {
	return http.post("/knowledge/base/qaRecommend/list", params);
}

// 知识库管理 提交知识点问题推荐任务
export async function qaRecommendSubmit(params) {
	return http.post("/knowledge/base/qaRecommend/submit", params);
}

// 保存知识点

export async function saveQA(params) {
	return http.post("/qa/add", params);
}

//编辑知识点
export async function editQa(params) {
	return http.post("/qa/edit", params);
}

// 知识点启用、停用

export async function updateQaStatus(params) {
	return http.post("/qa/disabled", params);
}

// 知识库管理 知识点详情（包含标准问、相似问和答案）

export async function getKnowledgeDetail(params) {
	return http.get("/qa/id", params);
}

// 知识库管理 详情 答案列表

export async function getQAJsonAnswers(params) {
	return http.post("/knowledge/base/qa/answer", params);
}

// 知识点相似问

export async function getAlikeQuestionList(params) {
	return http.post("/knowledge/base/getAlikeQuestionList", params);
}

// 知识点标准问

export async function getStandardQuestion(params) {
	return http.post("/knowledge/base/getStandardQuestion", params);
}

// 知识库管理 修改相似问
export async function editQustion(params) {
	return http.post("/knowledge/base/editQustion", params);
}

// 知识库管理 删除相似问
export async function deleteQuestion(params) {
	return http.post("/knowledge/base/deleteQuestion", params);
}

// 知识库管理 设置标准问
export async function topQuesion(params) {
	return http.post("/knowledge/base/topQuesion", params);
}

// 知识库管理 知识点移动分类
export async function updateQACategory(params) {
	return http.post("/qa/move", params);
}

// 知识库管理 知识点导出
export async function exportQA(params) {
	return http.downloadFileForPost("/qa/export", params);
}

// 知识库管理 知识点导入-验证
export async function importQACheck(params) {
	return http.get("/qa/checkImport", params);
}

// 知识库管理 知识点导入-终止导入
export async function cancelQaImport(params) {
	return http.get("/qa/interrupt", params);
}

// 知识库管理 选择知识点导出
export async function exportByQaIds(params) {
	return http.downloadFileForPost("/qa/exportByQaIds", params);
}

// 知识库管理 选择知识点导出-验证
export async function exportByQaIdsCheck(params) {
	return http.post("/qa/exportByQaIdsCheck", params);
}

// 知识库管理 重新发布
export async function postBatchSync(params) {
	return http.post("/qa/batchSync", params);
}

// 知识库管理 重新发布-验证
export async function getBatchSyncCheck(params) {
	return http.get("/qa/getQaRootCategoryAllQaSync", params);
}

// 知识库管理 知识点下载导入模板
export async function downladQA(params) {
	return http.downloadFile("/qa/download", params);
}

// 分类取消共享
export async function deleteSharedCategory(params) {
	return http.post("/knowledge/base/category/unshare", params);
}
/*
 * 修改记录
 * */

// 下载记录列表
export async function getQAHistories(params) {
	return http.get("/stat/qa/record/getQaHistoryRecord", params);
}

// 下载记录
export async function exportQAHistories(params) {
	return http.downloadFile("/knowledge/modify/record/export", params);
}

// 删除历史记录接口
export async function clearQAHistories(params) {
	return http.post("/robot/clearQAHistories", params);
}

/*
 * 回收站
 * */

// 搜索回收站知识点
export async function getQARecycle(params) {
	return http.get("/qa/recycle/list", params);
}

// 还原回收站知识点
export async function restoreQAJson(params) {
	return http.postFormData("/qa/recycle/restore", params);
}

// 彻底删除知识点
export async function removeQAForeverJson(params) {
	return http.postFormData("/qa/recycle/delete", params);
}

// 清空机器人回收站中的所有数据
export async function clearQARecycleJson(params) {
	return http.postFormData("/qa/recycle/clear", params);
}

// 知识点导入
export async function knowledgeImport(params) {
	return http.uploadFile("/qa/import", params);
}

// 获取qaId
export async function getQaIdByRequest(params) {
	return http.get("/knowledge/base/qaId", params);
}

// 获取导入模版
export async function getQaTemplate(params) {
	return http.downloadFile("/knowledge/base/import/template", params);
}

/*
 * 业务知识库
 * */

// 查询
export async function businessGetList(params) {
	return http.post("/jsdl/business/getList", params);
}

// 新增
export async function businessDoAdd(params) {
	return http.post("/jsdl/business/doAdd", params);
}

// 编辑
export async function businessDoEdit(params) {
	return http.post("/jsdl/business/doEdit", params);
}

// 删除
export async function businessdoRemove(params) {
	return http.post("/jsdl/business/doRemove", params);
}

// 获取指标名称列表
export async function getDictWordList(params) {
	return http.post("/jsdl/business/getDictWordList", params);
}

/*
 * 业务文档
 * */

// 文件列表
export async function cloudResIndex(params) {
	return http.get("/res/index", params);
}

// 下载文件
export async function businesxz(url, params) {
	return http.downloadFile(url, params);
}

// 删除文件
export async function removeFile(params) {
	return http.get("/res/removeFile", params);
}

/**
 * 答案库
 */

//树
export async function getAnswerTree(params) {
	return http.get("/answerLibrary/category/tree", params);
}
//删除分类
export async function answerNodeDelete(params) {
	return http.post("/answerLibrary/category/delete", params);
}
//新增分类
export async function answerNodeAdd(params) {
	return http.post("/answerLibrary/category/add", params);
}
//修改分类名
export async function answerNodeEdit(params) {
	return http.post("/answerLibrary/category/edit", params);
}
//获取列表
export async function getAnswerList(params) {
	return http.get("/answerLibrary/list", params);
}
//添加答案
export async function postAddAnswer(params) {
	return http.post("/answerLibrary/add", params);
}
//修改答案
export async function postEditAnswer(params) {
	return http.post("/answerLibrary/edit", params);
}
// 获取答案详细信息
export async function getInfoAnswer(params) {
	return http.get("/answerLibrary/info", params);
}
//删除答案
export async function answerDelete(params) {
	return http.get("/answerLibrary/delete", params);
}
// 答案引用
export async function getAnswerUseing(params) {
	return http.get("/answerLibrary/useing", params);
}
//获取答案库列表
export async function getAnswerAllList(params) {
	return http.get("/answerLibrary/AllList", params);
}

// 智能学习添加知识点
export async function addKnowledge(params) {
	return http.post("/learn/wait/ques/add", params);
}

// 聚类问题 新增知识点
export async function addKnowledgeCluster(params) {
	return http.post("/learn/knowledge/cluster/question/add", params);
}

// 推荐问题 新增知识点
export async function addKnowledgeAuto(params) {
	return http.post("/learn/knowledge/recommend/question/add", params);
}

//知识库查询
export async function doQueryQaList(params) {
	return http.get("/rootCategory/knowledgeList", params);
}
